home *** CD-ROM | disk | FTP | other *** search
/ Celestin Apprentice 2 / Apprentice-Release2.iso / Source Code / C / Code Resources / CalendarMenu MDEF / cTestWindow.c < prev    next >
Encoding:
C/C++ Source or Header  |  1994-10-28  |  1.1 KB  |  64 lines  |  [TEXT/KAHL]

  1. /*****
  2.  * cTestWindow.c
  3.  *
  4.  *        The window routines for the cTest demo
  5.  *
  6.  *****/
  7.  
  8. #include <Packages.h>
  9. #include "cTestWindow.h"
  10.  
  11. WindowPtr    cTestWindow;
  12. Rect        dragRect;
  13. Rect        windowBounds = { 140, 40, 200, 250 };
  14.  
  15. extern unsigned long menuDate;
  16.  
  17. /****
  18.  * SetUpWindow()
  19.  *
  20.  *    Create the cTest window, and open it.
  21.  *
  22.  ****/
  23.  
  24. void SetUpWindow(void)
  25.  
  26. {
  27.     dragRect = screenBits.bounds;
  28.     
  29.     cTestWindow = NewWindow(0L, &windowBounds, "\pCalendar Menu", true, noGrowDocProc, (WindowPtr) -1L, true, 0);
  30.     SetPort(cTestWindow);
  31. }
  32. /* end SetUpWindow */
  33.  
  34.  
  35. /*****
  36.  * DrawcTest()
  37.  *
  38.  *    Draws the date.
  39.     This is a quick sample only.  You should draw a better popup with a triangle at least.
  40.  *
  41.  *****/
  42.  
  43. void DrawcTest(short active)
  44.  
  45. {
  46.     Rect    myRect, box;
  47.     int        color = true;
  48.     Str255    temp;
  49.     
  50.     SetPort(cTestWindow);
  51.     SetRect( &box, 0,0,300,300 );
  52.     EraseRect( &box );
  53.     SetRect( &box, 120,20,190,40 );
  54.     FrameRect( &box );
  55.  
  56.     TextFont( 0 );
  57.     IUDateString(menuDate, 0, temp );
  58.     MoveTo( box.left+5, box.top+14);
  59.     DrawString( temp );
  60.  
  61.     MoveTo( 50,33 );
  62.     DrawString( "\pPopup Date:");
  63. }
  64. /* end DrawcTest */